package cn.zktr.Personnel.model.uitls;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import cn.zktr.Personnel.model.pojos.PerPmsPot;
import cn.zktr.Personnel.model.pojos.PerPmsZhiji;

public class Pot {
	private List<Map<String,Object>> pot;
	private Map<String,Object> json;
	
	public Pot(PerPmsZhiji ppz) {
		List<Map<String,Object>> list = new ArrayList<>();
		for(PerPmsPot ppp : ppz.getPerPmsPots()) {
			list.add(new Pots(ppp).getJson());
		}
		setPot(list);
		Map<String,Object> params=new HashMap<>();
		params.put("id",ppz.getZhijiid());
		params.put("text",ppz.getZhijiname());
		params.put("children",getPot());
		setJson(params);
	}

	public Map<String, Object> getJson() {
		return json;
	}
	public void setJson(Map<String, Object> pot2) {
		this.json = pot2;
	}
	public List<Map<String,Object>> getPot() {
		return pot;
	}
	public void setPot(List<Map<String,Object>> pot) {
		this.pot = pot;
	}
	class Pots {
		private Map<String,Object> json;
		
		public Pots(PerPmsPot ppp) {
			Map<String,Object> params=new HashMap<>();
			params.put("id",ppp.getPotid());
			params.put("text",ppp.getPotzw());
			setJson(params);
		}

		public Map<String, Object> getJson() {
			return json;
		}

		public void setJson(Map<String, Object> json) {
			this.json = json;
		}
		
		
	}
}
